classdef Instrument < handle
    %INSTRUMENT Summary of this class goes here
    %   Detailed explanation goes here
    
    properties(Access = protected)
        conn
    end
    
    properties
        GPIB_address
        GPIB_controller
        address
    end
    
    methods
        function this = Instrument(GPIB_controller, GPIB_address, address)
            this.address = address;
            this.GPIB_address = GPIB_address;
            this.GPIB_controller = GPIB_controller;
            this.conn = gpib(this.GPIB_controller,this.GPIB_address,this.address);
            this.conn.InputBufferSize = 20000;
            %resetting the device
            fopen(this.conn);
            fprintf(this.conn,'*RST');
        end
        
        function delete(this)
            fclose(this.conn);
        end
    end
    
end

